<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浪氏小白拼团 - 手写MyBatis：渐进式源码实践</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; font-family: "PingFang SC", sans-serif; }
        body { background: #f5f5f5; }

        /* 轮播图 */
        .swiper {
            height: 200px;
            overflow: hidden;
            position: relative;
        }
        .swiper img {
            width: 100%;
            height: 200px;
            object-fit: cover;
        }

        /* 商品信息 */
        .goods-info {
            background: white;
            padding: 15px;
        }
        .title { font-size: 18px; color: #333; margin-bottom: 8px; }
        .promotion {
            color: #e02e24;
            font-size: 14px;
            margin: 10px 0;
        }
        .countdown { color: #999; font-size: 12px; }

        /* 拼单列表 */
        .group-list {
            background: white;
            margin: 10px 0;
            padding: 15px;
        }
        .group-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #eee;
        }
        .group-item:last-child { border: none; }
        .user { color: #333; font-size: 15px; }
        .btn-buy {
            background: #e02e24;
            color: white;
            border: none;
            padding: 8px 20px;
            border-radius: 15px;
            font-size: 14px;
        }

        /* 价格区域 */
        .price {
            background: white;
            padding: 15px;
            text-align: right;
        }
        .original { text-decoration: line-through; color: #999; }
        .discount { color: #e02e24; font-size: 24px; }

        /* 操作按钮 */
        .action-btns {
            display: flex;
            gap: 10px;
            padding: 15px;
        }
        .btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 4px;
            font-size: 16px;
        }
        .btn-alone { background: #ff9500; color: white; }
        .btn-group { background: #e02e24; color: white; }

        /* 弹窗 */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            display: none;
            justify-content: center;
            align-items: center;
        }
        .modal-content {
            background: white;
            padding: 20px;
            border-radius: 8px;
            width: 80%;
            text-align: center;
        }
        .qrcode {
            width: 200px;
            height: 200px;
            background: #eee;
            margin: 15px auto;
        }
    </style>
</head>
<body>
<!-- 轮播图 -->
<div class="swiper">
    <img src="https://bugstack.cn/images/article/product/book/mybatis-03.png?raw=true" alt="">
    <img src="https://bugstack.cn/images/article/product/book/mybatis-03.png?raw=true" alt="">
    <img src="https://bugstack.cn/images/article/product/book/mybatis-03.png?raw=true" alt="">
</div>

<!-- 商品信息 -->
<div class="goods-info">
    <h1 class="title">手写MyBatis：渐进式源码实践（全彩）</h1>
    <div class="promotion">大促优惠 | 直降 ¥60，76人再抢，参与马上抢到</div>
</div>

<!-- 拼单列表 -->
<div class="group-list">
    <div class="group-item">
        <span class="user">浪氏小白</span>
        <span class="countdown">剩余 00:05:49</span>
        <button class="btn-buy">立即抢单</button>
    </div>
    <div class="group-item">
        <span class="user">李二狗</span>
        <span class="countdown">剩余 00:05:49</span>
        <button class="btn-buy">立即抢单</button>
    </div>
</div>

<!-- 价格区域 -->
<div class="price">
    <span class="original">¥100</span>
    <span class="discount">¥20</span>
</div>

<!-- 操作按钮 -->
<div class="action-btns">
    <button class="btn btn-alone">单独购买</button>
    <button class="btn btn-group">开团购买</button>
</div>

<!-- 支付弹窗 -->
<div id="paymentModal" class="modal">
    <div class="modal-content">
        <h3>请扫码支付</h3>
        <div class="qrcode"></div>
        <p>支付金额 ¥40</p>
        <div style="margin-top: 20px;">
            <button onclick="closePayment()">取消支付</button>
            <button onclick="completePayment()">支付完成</button>
        </div>
    </div>
</div>

<!-- 登录弹窗 -->
<div id="loginModal" class="modal" style="display: flex;">
    <div class="modal-content">
        <h3>欢迎登录 - 浪氏小白拼团</h3>
        <input type="text" placeholder="用户名" style="width:100%; margin:10px 0; padding:8px;">
        <input type="password" placeholder="密码" style="width:100%; margin:10px 0; padding:8px;">
        <button onclick="login()" style="width:100%; padding:10px; background:#e02e24; color:white; border:none; margin-top:15px;">登录</button>
    </div>
</div>

<script>
    // 显示支付弹窗
    document.querySelectorAll('.btn-buy, .btn').forEach(btn => {
        btn.addEventListener('click', () => {
            if(!isLoggedIn()) {
                showLogin();
            } else {
                document.getElementById('paymentModal').style.display = 'flex';
            }
        });
    });

    // 登录状态模拟
    let loggedIn = false;
    function isLoggedIn() { return loggedIn; }
    function login() {
        loggedIn = true;
        document.getElementById('loginModal').style.display = 'none';
        document.getElementById('paymentModal').style.display = 'flex';
    }

    function showLogin() {
        document.getElementById('loginModal').style.display = 'flex';
    }

    function closePayment() {
        document.getElementById('paymentModal').style.display = 'none';
    }

    function completePayment() {
        alert('支付成功！');
        closePayment();
    }
</script>
</body>
</html>